From: Fredrik Eriksson Date: Thu, 2 Jan 2025 13:46:32 +0000 (+0100) Subject: Fix index check X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~157^2~1 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=65db9a0253e1b132eee14ce22772c4179b545e13;p=nextcloud-desktop.git Fix index check Also fixes handling of empty netrc. Signed-off-by: Fredrik Eriksson --- diff --git a/src/cmd/netrcparser.cpp b/src/cmd/netrcparser.cpp index 15417e134..f9b95c762 100644 --- a/src/cmd/netrcparser.cpp +++ b/src/cmd/netrcparser.cpp @@ -56,6 +56,9 @@ bool NetrcParser::parse() return false; } QString content = netrc.readAll(); + if (content.isEmpty()) { + return false; + } auto tokens = content.split(QRegularExpression("\\s+")); @@ -71,9 +74,9 @@ bool NetrcParser::parse() } i++; - if (i > tokens.count()) { + if (i >= tokens.count()) { qDebug() << "error fetching value for" << key; - return false; + break; } auto value = tokens[i];